Skip to content

Conversation

gouthampacha
Copy link
Contributor

@gouthampacha gouthampacha commented Sep 19, 2025

What this PR does / why we need it:

The CephFS partner plugin now requires a parameter
called 'fsName' to explicitly specify a CephFS filesystem
name to locate subvolumes on a Ceph cluster with
multiple CephFS filesystems. This PR reads the value
of the 'fsName' from share metadata in Manila.

Which issue this PR fixes(if applicable):
fixes #2992
fixes #2986

Release note:

The Manila CSI driver now extracts metadata of the underlying Manila share to fetch the ceph filesystem name. This fixes volume resolution in environments with multiple CephFS filesystems.  

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gouthampacha for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 19, 2025
This option is now mandatory to use when there
are multiple CephFS file systems in the ceph
cluster. Without this, ceph won't be able to find
the (sub)volume to mount.
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Sep 19, 2025
@gouthampacha
Copy link
Contributor Author

@1602077 @nfroger

does this work for you?

@1602077
Copy link

1602077 commented Sep 30, 2025

Hi @gouthampacha - Thank you for proposing this. I have tested this patch in our environment but I am still running into the same issue. I've detailed below the steps I've taken so please do correct me if I'm doing something wrong / misunderstanding.

Cheers,
Jack


  • Created an openstack share manually with appropriate mount options.
 $ openstack share show cephfs-upstream -c properties -f value
{'__mount_options': 'fs=my_fs'}
  • Created an access rule on this share if one does not already exist.
$ openstack share access create ${SHARE_ID} cephx ${SHARE_NAME} --access-level rw
  • Applied the following to mount the share to a pod
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: manila-preprovisioned-pv
spec:
  csi:
    driver: cephfs.manila.csi.openstack.org
    volumeHandle: my-preprovisioned-manila-vol
    volumeAttributes:
      shareID: "**redacted**" # openstack share id
      shareAccessID: "**redacted**" # openstack share access list $SHARE_ID -c ID -f value
    nodeStageSecretRef:
      name: os-trustee
      namespace: kube-system
    nodePublishSecretRef:
      name: os-trustee
      namespace: kube-system
  accessModes:
    - ReadWriteMany
  capacity:
    storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-preprovisioned-manila-vol
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
  volumeName: manila-preprovisioned-pv
  storageClassName: ""
---
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
    - name: nginx
      image: nginx
      imagePullPolicy: IfNotPresent
      ports:
        - containerPort: 80
          protocol: TCP
      volumeMounts:
        - mountPath: /var/lib/www/html
          name: my-vol
  volumes:
    - name: my-vol
      persistentVolumeClaim:
        claimName: my-preprovisioned-manila-vol
        readOnly: false

I can see in the nodeplugin logs that the fs is now correctly being pulled from the __mount_options metadata.

$ kubectl logs -n kube-system cern-magnum-openstack-manila-csi-nodeplugin-m27dm -c cephfs-nodeplugin | grep fs_name
I0930 08:02:02.030147       1 cephfs.go:140] Found fs_name in share metadata: my_fs

But looking at the pod which mounts this container the fs_name is not passed to the mount command: the only option passed is noatime. This leaves the container stuck in ContainerCreating.

Warning  FailedMount  20s  kubelet  MountVolume.MountDevice failed for volume "manila-preprovisioned-pv" : rpc error: code = Internal desc = an error (exit status 1) occurred while running ceph-fuse args: [/var/lib/kubelet/plugins/kubernetes.io/csi/cephfs.manila.csi.openstack.org/xxx/globalmount -m **monitors** -c /etc/ceph/ceph.conf -n client.cephfs-upstream --keyfile=***stripped*** -r /volumes/_nogroup/yyy/zzz -o noatime] stderr: 2025-09-30T08:04:10.418+0000 7efeea243580 -1 init, newargv = 0x56072b9e69f0 newargc=15
2025-09-30T08:04:10.418+0000 7efeea243580 -1 init, args.argv = 0x56072bb3bc00 args.argc=4
ceph-fuse[773512]: starting ceph client
ceph-fuse[773512]: ceph mount failed with (2) No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
3 participants